import { httpClient } from '@/utils/http/axios';
import { ErrorMessageMode } from '#/axios';
import { RpcLogOutputDto } from './model';
import { PageRequest, PageData } from '@/utils/common/types';

/** RPC日志枚举 */
enum Api {
  /** 读取RPC日志 */
  Read = '/api/iot/admin/rpcLog/read',
}

//#region 读取RPC日志
/**
 * 读取RPC日志
 * @param request 分页请求
 * @param mode 错误消息模型
 */
export function readRpcLog(request: PageRequest, mode: ErrorMessageMode = 'message') {
  return httpClient.post<PageData<RpcLogOutputDto>>(
    {
      url: Api.Read,
      params: request,
    },
    {
      errorMessageMode: mode,
    },
  );
}
//#endregion
